% Get a market code randomly
% Input: null
% Output: market_code
function market_code = getRandomMarketCode()
    % get all market codes from database
    query = 'select s.Name from security s, securitytype st where s.ID_SecurityType = st.ID and st.Type = ''Index''';
    output_table = selectData(query);    
	
	if (sum(size(output_table)) > 2) % if exists several markets
        [number_of_market temp] = size(output_table);
        market_code = output_table(randi(number_of_market));
    else % if don't exists any markets
        market_code = [];
    end
end